% NCRastrigin
function result = NCRastrigin(x)
result = 0;
len = length(x);
for i = 1:len
    if abs(x(i)) < 0.5
        x(i) = x(i);
    else
        x(i) = round(2*x(i)) / 2;
    end
    temp = x(i)^2 - 10 * cos(2*pi*x(i)) + 10;
    result = result + temp;
end
end